import { useMemo } from "react";
import { useUrlQuery } from "utils/url";

export const usePorjectSearchParam = () => {
  const [param, setParam] = useUrlQuery(["name", "personId"]);
  const projectParam = useMemo(
    () => ({ ...param, personId: Number(param.personId) || undefined }),
    [param]
  );
  return [projectParam, setParam] as const;
};
